package com.xiaoyu.lanling.event.coin

import `in`.srain.cube.concurrent.SimpleTask
import `in`.srain.cube.request.JsonData
import android.text.TextUtils
import com.xiaoyu.base.app.AppContext
import com.xiaoyu.base.app.GlobalUI
import com.xiaoyu.base.event.BaseJsonEvent
import com.xiaoyu.lanling.R

class CoinAccostEvent(requestTag: Any, jsonData: JsonData) : BaseJsonEvent(requestTag, jsonData) {
    val uid = jsonData.optString("uid")
    val showVerifyAndVoiceDialog = jsonData.optBoolean("showVerifyAndVoiceDialog")

    init {
        if (!showVerifyAndVoiceDialog && !TextUtils.isEmpty(uid)) {
            SimpleTask.post {
                GlobalUI.getInstance().showToast(AppContext.getString(R.string.accost_success_toast))
            }
        }
    }
}